<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <title>防伪查询</title>

    <link th:href="@{/erp/assets/css/bootstrap.min.css}" rel="stylesheet"/>
    <link rel="stylesheet" th:href="@{/erp/css/style.css}"/>
    <link rel="stylesheet" th:href="@{/erp/assets/css/ace.min.css}"/>
    <link rel="stylesheet" th:href="@{/erp/assets/css/font-awesome.min.css}"/>
    <script th:src="@{/erp/js/jquery-1.9.1.min.js}"></script>
    <script th:src="@{/erp/assets/js/bootstrap.min.js}"></script>
    <script th:src="@{/erp/assets/js/jquery.dataTables.min.js}"></script>
    <script th:src="@{/erp/assets/js/jquery.dataTables.bootstrap.js}"></script>
    <script th:src="@{/erp/assets/js/typeahead-bs2.min.js}"></script>
    <script th:src="@{/erp/assets/layer/layer.js}" type="text/javascript"></script>
    <script th:src="@{/erp/js/lrtk.js}" type="text/javascript"></script>
    <script th:src="@{/erp/assets/laydate/laydate.js}" type="text/javascript"></script>

    <link th:href="@{/erp/Widget/icheck/icheck.css}" rel="stylesheet" type="text/css"/>
<!--    <script type="text/javascript" th:src="@{/erp/js/H-ui.js}"></script>-->
<!--    <script type="text/javascript" th:src="@{/erp/js/H-ui.admin.js}"></script>-->
</head>

<body>
<div class="search_style clearfix">
    <ul class="search_content clearfix">
        <li><label class="l_f">&nbsp;激光码查询：</label><input id="lCode" type="text" class="text_add" placeholder="输入激光码"
                                                          style=" width:250px"/></li>
        <li style="width:90px;">
            <button type="button" class="btn_search" id="find"><i class="icon-search"></i>查询</button>
        </li>
    </ul>
</div>
<div class="page-content clearfix" style="display:none;" id="hh">
    <div class="brand_detailed">
        <div class="brand_info clearfix">
            <div class="title_brand">产品信息</div>
            <form>
                <ul class="Info_style clearfix" id="one">
                </ul>
            </form>
        </div>
    </div>


    </tbody>
    </table>
</div>
</div>
</div>

<script type="text/javascript">
    //数据
    $("#find").on('click', function () {
        var lCode = $("#lCode").val();
        if (lCode == "") {
            $("#hh").hide();
            layer.msg('必须输入激光码', {icon: 5, time: 2000});
        } else {
            $("#one").empty();
            $.ajax({
                url: '/laser/find',
                type: 'post',
                dataType: 'json',
                data: {
                    code: lCode
                },
                success: function (e) {
                    console.log(e.data);
                    if (e.data.qtimes == null) {
                        $("#hh").hide();
                        layer.msg('该激光码不属于本公司', {icon: 5, time: 2000});
                    } else {
                        $("#one").append("<li><label class=\"label_name\">您好：</label><span class=\"name\"><span>这是您第<b>" + e.data.qtimes + "</b>次查询</span></span></li>");
                        $("#one").append("<li><label class=\"label_name\">产品名称：</label> <span class=\"name\">" + e.data.pname + "</span></li>");
                        $("#one").append("<li><label class=\"label_name\">产品类型：</label><span class=\"name\">" + e.data.pbrand + "</span></li>");
                        $("#one").append("<li style='width: 350px'><label class=\"label_name\">生产地址：</label><span class=\"name\">" + e.data.companyProvince + e.data.companyCity + e.data.companyArea + e.data.companyAddress + "</span></li>");
                        $("#one").append("<li><label class=\"label_name\">生产时间：</label><span class=\"name\">" + e.data.ptime + "</span></li>");
                        $("#hh").show();
                    }
                }
            })
        }
    })


</script>

</body>
</html>

